# Maintainer: Antonio Rojas <arojas@archlinux.org>

pkgname=coxeter
pkgver=git.20180226
pkgrel=3
_commit=7b5a1f0039511326aeb616afb132a5065886b9d8
pkgdesc="A library for the study of combinatorial aspects of Coxeter group theory"
arch=(loong64 x86_64)
url="https://github.com/tscrim/coxeter"
license=(GPL3)
depends=(gcc-libs)
makedepends=(git)
conflicts=(coxeter3)
replaces=(coxeter3)
source=("git+https://github.com/tscrim/coxeter#commit=$_commit" coxeter-sage.patch coxeter-makefile.patch)
sha256sums=('SKIP'
            '668235f7858c4542d2856d6b36f2f1d18f14ffea685a96637992a14613a71688'
            'dc82e9ce42ebd0f00eca08e771d4115370053b75d3dac1368620a1c66292c030')

prepare() {
  cd coxeter
# Add Sage patches
  patch -p1 -i ../coxeter-sage.patch
  patch -p1 -i ../coxeter-makefile.patch
}  

build() {
  cd coxeter

  make all
}

package() {
  cd coxeter
  mkdir -p "$pkgdir"/usr/{lib,bin}
  make SAGE_LOCAL="$pkgdir/usr" install
}
